package com.ys.io;

import java.net.URL;

/**
 * <p>@description:资源加载器</p>
 *
 * @projectName: Spring-Mini
 * @packageName: com.com.ys.io
 * @className:
 * @author: shuangyang
 * @date: 1/14/17 11:15 PM
 */
public class ResourceLoader {
    /**
     * 通过路径加载资源
     *Return the resource with given specified location
     * @param location
     * @return
     */
    public Resource getResource(String location) {
        URL resource = this.getClass().getClassLoader().getResource(location);
        return new UrlResource(resource);
    }
}
